package schoolWork.work02;

import java.awt.*;

public class round {
    //属性
    public Point centerOfRound;
    private double radius;

    //构造方法
    public round(){};
    public round(Point centerOfRound, double radius) {
        this.centerOfRound = centerOfRound;
        this.radius = radius;
    }

    //方法


    public void setRadius(double radius) {
        this.radius = radius;
    }

    public Point getCenterOfRound() {
        return centerOfRound;
    }

    public double getRadius() {
        return radius;
    }

    public double getArea() {
        return Math.PI * radius * radius;
    }

    public double getPerimeter() {
        return 2 * Math.PI * radius;
    }

    public void getRoundInfo() {
        //System.out.println("圆心坐标为：" + centerOfRound.getX() + " " + centerOfRound.getY());
        System.out.println("半径为：" + radius);
        System.out.println("面积为：" + getArea());
        System.out.println("周长为：" + getPerimeter());
    }
}
